package com.fs.ibox_h.servie.impl;

import com.fs.ibox_h.dao.OrdersDao;
import com.fs.ibox_h.pojo.Orders;
import com.fs.ibox_h.servie.MarketOrdersService;
import com.fs.ibox_h.util.BeanFactory;
import com.fs.ibox_h.vo.Condition;
import com.fs.ibox_h.vo.Page;

import java.util.List;

public class MarketOrdersServiceImpl implements MarketOrdersService {

    OrdersDao service = BeanFactory.createBean(OrdersDao.class);

    @Override
    public Page<Orders> selectByCondition(int currentPage, int pageSize, Condition condition) {
        Page<Orders> page = new Page<>();
        page.setCurrentPage(currentPage);
        page.setPageSize(pageSize);
        page.setCount(service.count(condition));
        page.setRecords(service.selectByCondition(currentPage,pageSize,condition));
        return page;
    }

    @Override
    public List<Orders> selectByCondition(Condition condition) {

        return service.queryAll();
    }


}
